<%-- 
    Document   : login
    Created on : Jun 19, 2010, 6:43:33 PM
    Author     : jlajlar
--%>

<%@page import="gandalf.model.Stranka"%>
<%@page import="gandalf.controller.StrankaJpaController"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <link rel="stylesheet" href="css/style.css" type="text/css" media="screen, projection">
        <link rel="stylesheet" href="blueprint/src/forms.css" type="text/css" media="screen, projection">
        <title>JSP Page</title>
    </head>
     <%

                    Long idStranke = (Long) request.getSession().getAttribute("stranka_id");
                    StrankaJpaController strankaDao = new StrankaJpaController();
                    Stranka stranka = null;
                    if (idStranke != null) {
                        stranka = strankaDao.findStranka(idStranke);
                    }

        %>
    <body>
        <div id="header">
            <h1 id="logo">Gandalf</h1>
            <ul id="nav">
                <li><a href="index.jsp">Dogodki</a></li>
                <li><a href="mailto:gandalf_support@gmail.com">Kontakt</a></li>
                <li><a href="<%= stranka != null ? "logout.jsp" : "login.jsp"%>">
                        <%= stranka != null ? "Odjava" : "Prijava"%></a></li>
            </ul>
        </div><!-- header -->
        <div id="section">
            <%
                        String notice = (String) request.getSession().getAttribute("notice");
                        if (notice != null) {
                            request.getSession().setAttribute("notice", null);
            %>
            <p class="notice">
                <%= notice%>
            </p>
            <% }%>
            <div id="login">
                <form action="Login" method="POST">
                    <fieldset>
                        <legend>Če že imate račun, se prijavite tukaj</legend>
                        <ul>
                            <li>
                                <label for="email">E-mail</label><br>
                                <input name="email" type="text" />
                            </li>
                            <li>
                                <label for="password">Geslo</label><br>
                                <input name="password" type="password" />
                            </li>
                            <li>
                                <input name="submit" value="Prijava" type="submit" />
                            </li>
                        </ul>
                    </fieldset>

                </form>
            </div>

            <div id="registracija">
                <form id="registracija" action="Registracija" method="POST">
                    <fieldset>
                        <legend>Nov uporabnik?</legend>

                        <ul>
                            <li>
                                <label for="ime">Ime</label><br>
                                <input name="ime" type="text" />
                            </li>
                            <li>
                                <label for="priimek">Priimek</label><br>
                                <input name="priimek" type="text" />
                            </li>
                            <li>
                                <label for="naslov">Naslov</label><br>
                                <input name="naslov" type="text" />
                            </li>
                            <li>
                                <label for="kraj">Kraj</label><br>
                                <input name="kraj" type="text" />
                            </li>
                            <li>
                                <label for="email">E-mail</label><br>
                                <input name="email" type="text" />
                            </li>
                            <li>
                                <label for="password">Geslo</label><br>
                                <input name="password" type="password" />
                            </li>
                            <li>
                                <label for="narocen">Naročen na novice</label><br>
                                <input type="checkbox" name="narocen" value="1" />
                            </li>
                            <li>
                                <input name="submit" value="Registriraj me" type="submit" />
                            </li>
                        </ul>
                    </fieldset>
                </form>
            </div>
        </div>
    </body>
</html>
